home *** CD-ROM | disk | FTP | other *** search
-
-
- TEST TEST
-
-
- NAME
- test
-
-
- SYNOPSYS
- test expression
-
-
- DESCRIPTION
- test evaluates logical expressions. test returns an exit code
- of 0 if the condition is true or 1 if the condition is false.
- This program is used mainly as the subject of the if command in
- shell scripts.
-
-
- ARGUMENTS
- An expression which consists of one or more terms separated by
- and/or operators.
-
- -a is the and operator & separates two terms.
- -o is the or operator & separates two terms.
-
- A term is an expression enclosed in parentheses or:
-
- str1 relop str2 where relop is one of:
- = true if the two strings are identical
- != true if the two strings are different
-
- val1 relop val2 where relop is one of:
- -lt true if val1 is less than val2
- -le true if val1 is less than or equal to val2
- -eq true if val1 is equal to val2
- -ne true if val1 is not equal to val2
- -ge true if val1 is greater than or equal to val2
- -gt true if val1 is greater than val2
-
- -r filename true if file exists & you have read access
- -w filename true if file exists & you have write access
- -d filename true if file exists & is a directory
- -f filename true if file exists & is a plain file
- -s filename true if file exists & is not empty
-
- ! term the negation of term
-
- Each operator/operand must be a separate argument separated by
- white space.
-
-
- DIAGNOSTICS
- test returns -1 if it encounters an error or is unable to allocate
- memory, otherwise test returns 1 if the expression is false or 0 if
- the expression is true. No error messages are printed.
-
-
-
-
-
-
-
-
-
-
-
-
- NOTES
- test is not a full implementation of the *NIX test utility,
- and is in fact far inferior to the bsh builtin expression
- evaluator. test is mainly used in unpacking shell-archives
- and is not intended for general use.
- test may be made resident either by rez, by the c:Resident
- command. Since it was linked with the Lattice cres.o module,
- rez thinks it is not shareable.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-